﻿using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using BlogEngine.Core;
using System.IO;
using System.Collections;

public partial class StandardSite : System.Web.UI.MasterPage
{
  protected void Page_Load(object sender, EventArgs e)
  {
		if (Security.IsAuthenticated)
		{
            aUser.InnerText = "Welcome " + Page.User.Identity.Name + "!";
			aLogin.InnerText = Resources.labels.logoff;
			aLogin.HRef = Utils.RelativeWebRoot + "Account/login.aspx?logoff";
		}
		else
		{
			aLogin.HRef = Utils.RelativeWebRoot + "Account/login.aspx";
			aLogin.InnerText = Resources.labels.login;
		}
  }


    protected string GetGalleryMenu()
{
    string result = "";
    foreach (string item in Directory.GetDirectories(MapPath("/gallery/")))
    {
        DirectoryInfo di = new DirectoryInfo(item);
        if (this.Request.Url.Query.ToLower().Contains(
                       Uri.EscapeUriString(di.Name.ToLower())))
            result += "<option value=\"/gallery.aspx?gal=" + 
            di.Name + "\" selected>" + di.Name + "</option>\n";
        else
            result += "<option value=\"/gallery.aspx?gal=" + 
            di.Name + "\">" + di.Name + "</option>\n";
     }
    return result;
}








}
